﻿using System;
using System.Collections.Generic;

namespace Comsenz.Services.Blocks.Configs
{
    /// <summary>
    /// 模块字段
    /// </summary>
    /// <author>Chiron</author>
    public class BlockField
    {
        #region Ctors
        /// <summary>
        /// 构建一个模块字段
        /// </summary>
        public BlockField()
        {
        }
        /// <summary>
        /// 构建一个模块字段
        /// </summary>
        /// <param name="name">该字段的显示名称</param>
        /// <param name="formType">该字段的显示方式</param>
        /// <param name="dataType">该字段的数据展示</param>
        public BlockField(string name, FormType formType, DataType dataType)
        {
            Name = name;
            FormType = formType;
            DataType = dataType;
        }
        #endregion Ctors

        #region Props
        /// <summary>
        /// 该字段的显示名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 该字段的显示方式
        /// </summary>
        public FormType FormType { get; set; }
        /// <summary>
        /// 该字段的数据展示
        /// </summary>
        public DataType DataType { get; set; }
        #endregion Props

        #region Methods
        /// <summary>
        /// 取得配置值
        /// </summary>
        /// <returns></returns>
        public Dictionary<object, object> GetConfigValue()
        {
            return new Dictionary<object, object>
            {
                {"name",Name},
                {"formtype",FormType},
                {"datatype",DataType}
            };
        }
        #endregion Methods

    }
}
